package top.laoliu.mapper;

import org.apache.ibatis.annotations.Param;
import top.laoliu.pojo.ApplyInfo;
import top.laoliu.pojo.Company;
import top.laoliu.pojo.CompanyInfo;

import java.util.List;

/**
 * @Author: acer
 * @Date: 2020/10/7 19:57
 * @Description: 公司用户dao层
 */
public interface CompanyMapper {
    /**
     * 注册用户
     * @param company 插入用户
     * @return 成功返回>0 失败返回0
     */
    int insertCompany(Company company);

    /**
     * 删除
     * @param company_id 用户id
     * @return
     */
    int deleteCompany(Integer company_id);

    /**
     * 根据id查询用户
     * @param company_id
     * @return
     */
    Company getCompanyById(Integer company_id);

    /**
     * 根据email查询用户
     * @param email
     * @return
     */
    Company getCompanyByEmail(String email);

    Company getCompanyByPhone(String phone);

    /**
     * 根据email password查询用户，存在返回Company，不存在返回null  实现登录功能
     * @param email
     * @param password
     * @return
     */
    Company companyLogin(@Param("email") String email, @Param("password") String password);


    int updateCompany(Company company);

    List<ApplyInfo> getApplyInfoByCompany_id(Integer company_id);

    int insertCompanyInfo(CompanyInfo companyInfo);

    int updateCompanyInfo(CompanyInfo companyInfo);

    CompanyInfo getCompanyInfo(Integer info_id);
}
